<template>
    <view class="accumulate-list-item" @click="goDetail">
        <view class="item-main">
            <image class="image" mode="aspectFill" :src="easyGetImgUrl(item.Images)"></image>
            <view class="info">
                <view class="name">
                    <text class="name-text">{{ item.Name }}</text>
                    <text class="price">价值￥{{ item.ProductPrice }}</text>
                </view>
                <view class="action">
                    <view class="text-view">
                        <view class="left">
                            <text class="tip">购买指定商品</text>
                            <text class="limit">满{{ item.AddupRecord }}元</text>
                        </view>
                        <image class="line" src="/static/img/img_jiaonang_bg@2x.png"></image>
                        <view class="right">
                            <text>免费拿走</text>
                        </view>
                    </view>
                    <!-- <image class="bg" src="/static/img/img_jaonang@2x.png"></image> -->
                </view>
            </view>
        </view>
        <text class="item-time">活动时间：{{ item.StartTime }} 至 {{ item.EndTime }}</text>
    </view>
</template>

<script>
export default {
    props: {
        item: {
            type: Object,
            default: () => {},
        },
    },
    components: {},
    data() {
        return {}
    },
    methods: {
        goDetail() {
            this.easyGoTo(
                "/pages_shop/packet/accumulate/detail?id=" +
                    this.item.ID +
                    "&item=" +
                    encodeURIComponent(JSON.stringify(this.item)),
            )
        },
    },
}
</script>

<style lang="scss">
.accumulate-list-item {
    display: flex;
    flex-direction: column;
    padding: $app-page-padding;
    background: $color-white;
    border-radius: 16rpx;
    margin: 0 1rpx;
    margin-bottom: 12rpx;
    .item-main {
        display: flex;
        flex-direction: row;
        margin-bottom: $app-page-padding;
    }
    .item-time {
        color: #1e1e1e;
        font-size: $font-size-24;
    }
    .image {
        width: 224rpx;
        height: 224rpx;
        border-radius: 8rpx;
        margin-right: $app-page-padding;
    }
    .info {
        display: flex;
        flex-direction: column;
        flex: 1;
        justify-content: space-between;
        .name {
            margin-bottom: 20rpx;
            display: flex;
            flex-direction: column;
            .name-text {
                font-size: $font-size-28;
                font-weight: 700;
                margin-bottom: 8rpx;
            }
            .price {
                color: #cd6300;
                font-size: $font-size-24;
            }
        }
        .action {
            display: flex;
            flex-direction: row;
            position: relative;
            height: 64rpx;
            border-radius: 100rpx;
            background: #ffeeb8;
            .tag {
                flex: 1;
            }
            .btn {
                background: #ff4e30;
                width: 100%;
                color: $color-white;
                border-radius: 100rpx;
            }
            .text-view {
                position: relative;
                z-index: 1;
                display: flex;
                flex-direction: row;
                align-items: center;
                width: 100%;
                .left {
                    display: flex;
                    flex-direction: column;
                    flex: 3;
                    justify-content: center;
                    align-items: center;
                    background: #f52c1f;
                    border-radius: 100rpx 0 0 100rpx;
                    height: 64rpx;
                    text {
                        color: $color-white;
                    }
                    .tip {
                        display: flex;
                        font-size: $font-size-16;
                    }
                    .limit {
                        display: flex;
                        font-size: $font-size-28;
                        font-weight: 500;
                    }
                }
                .right {
                    flex: 2;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    // background: #ffeeb8;
                    border-radius: 0 100rpx 100rpx 0;
                    z-index: 1;
                    text {
                        color: #ec612a;
                        font-size: $font-size-28;
                    }
                }
                .line {
                    position: absolute;
                    width: 58rpx;
                    height: 64rpx;
                    left: calc(60% - 30rpx);
                    z-index: 0;
                }
            }
            .bg {
                position: absolute;
                z-index: 0;
                top: 0;
                width: 100%;
                height: 64rpx;
            }
        }
    }
}
</style>
